import Mat3 from "../common/mat3";
import CONSTANT from "../constant";
import Method from "../common/method";

export default class RigidBodyConfig {
    constructor(optional={}) {
        this.position = Method.convertVec3(optional.position);
        this.rotation = optional.rotation? new Mat3().fromQuat(Method.convertQuat(optional.rotation)):new Mat3();
        this.linearVelocity = Method.convertVec3(optional.linearVelocity);
        this.angularVelocity = Method.convertVec3( optional.angularVelocity);
        this.type = optional.type||CONSTANT.RIGID_BODY_TYPE_DYNAMIC;
        this.autoSleep = optional.autoSleep!==undefined?optional.autoSleep:true;
        this.linearDamping = optional.linearDamping||0;
        this.angularDamping = optional.angularDamping|| 0;
        this.name=optional.name||'';
    }
}